<!doctype html>
<html lang="zh-cn">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>毛玻璃效果</title>
  <link rel="stylesheet" href="./styles/index.css">
</head>
<style>
  html,
  body {
    width: 100%;
    height: 100%;
    background-image: url("https://images.unsplash.com/photo-1440688807730-73e4e2169fb8?dpr=1&auto=format&fit=crop&w=1500&h=1001&q=80&cs=tinysrgb&crop=");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: top;
    overflow: hidden;
  }

  div {
    position: relative;
    width: 30vw;
    height: 40vh;
    background: inherit;
    margin: 50px auto;
    padding: 5vmin;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.5);
  }
  div p {
    position: relative;
    color: #000;
    z-index: 10;
    font-size: 24px;
    line-height: 1.5;
  }
  div::after {
    position: absolute;
    content: "";
    background: inherit;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    filter: blur(10px);
    z-index: 0;
  }
</style>
<body>
<div>
  <p>使用 <br />background-attachment: fixed <br />filter: bulr() <br />实现毛玻璃效果</p>
</div>
</body>
</html>
